package com.Cychat.pet.mapper;

import com.Cychat.commons.entity.pojo.Pet;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * Auther: 谢宝辉  <br/>
 * Date: 2025/10/30:17:39  <br/>
 * Description: 宠物Mapper
 */
@Mapper
public interface PetMapper extends BaseMapper<Pet> {

    /**
     * Description : 根据用户ID查询宠物主人ID
     * ChangeLog : 1. 创建 (2025/10/29 17:48 [Lenovo]);
     * @auther: 谢宝辉
     * date: 2025/10/29:17:48
     * @param userId
     * @return java.lang.Integer
     */
    @Select("SELECT owner_id FROM pet_owner WHERE user_id = #{userId}")
    Integer getPetOwnerIdByUserId(Long userId);
}
